﻿@using ModelLayer.Common
@{
    var userRole = (string)Session["UserRole"];
}

<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.PageTitle</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta content="" name="description" />
    <meta content="" name="author" />
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css">
    <link href="@Url.Content("~/Content/Template/assets/global/plugins/font-awesome/css/font-awesome.min.css")" rel="stylesheet" type="text/css">
    <link href="@Url.Content("~/Content/Template/assets/global/plugins/simple-line-icons/simple-line-icons.min.css")" rel="stylesheet" type="text/css">
    <link href="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap/css/bootstrap.min.css")" rel="stylesheet" type="text/css">
    <link href="@Url.Content("~/Content/Template/assets/global/plugins/uniform/css/uniform.default.css")" rel="stylesheet" type="text/css">
    <link href="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-ladda-ui/ladda-themeless.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-toastr/toastr.min.css")" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL STYLES -->
    <link href="@Url.Content("~/Content/Template/assets/admin/pages/css/error.css")" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL STYLES -->
    <!-- BEGIN THEME STYLES -->
    <link href="@Url.Content("~/Content/Template/assets/global/css/components.css")" id="style_components" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Template/assets/global/css/plugins.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Template/assets/admin/layout2/css/layout.css")" rel="stylesheet" type="text/css" />
    <link id="style_color" href="@Url.Content("~/Content/Template/assets/admin/layout2/css/themes/grey.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Template/assets/admin/layout2/css/custom.css")" rel="stylesheet" type="text/css" />
    <!-- END THEME STYLES -->
    <link rel="shortcut icon" type="image/ico" href="@Url.Content("~/favicon.ico")" />
    <link href="@Url.Content("~/Content/Template/assets/global/plugins/jquery-ui/jquery-ui.min.css")" rel="stylesheet" />

    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" />
    <!-- BEGIN jQUERY SCRIPT -->
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery.min.js")"></script>
    <!-- END jQUERY SCRIPT -->
    @RenderSection("Stylesheets", false)
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
<body class="page-container-bg-solid page-sidebar-closed-hide-logo page-header-fixed">

    <!-- BEGIN HEADER -->
    <div class="page-header navbar navbar-fixed-top">
        <!-- BEGIN HEADER INNER -->
        <div class="page-header-inner">
            <!-- BEGIN LOGO -->
            <div class="page-logo">
                <a class="site-logo" href="@Url.Action("Index", "Home", new {area = ""})"> Shop Kart </a>
                <div class="menu-toggler sidebar-toggler">
                    <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->
                </div>
            </div>
            <!-- END LOGO -->
            <!-- BEGIN RESPONSIVE MENU TOGGLER -->
            <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a>
            <!-- END RESPONSIVE MENU TOGGLER -->
            <!-- BEGIN PAGE TOP -->
            @RenderSection("PageTop", false)
            <!-- END PAGE TOP -->
        </div>
        <!-- END HEADER INNER -->
    </div>
    <!-- END HEADER -->

    <div class="clearfix"> </div>

    <!-- BEGIN CONTAINER -->
    <div class="page-container">
        <!-- BEGIN SIDEBAR -->
        @RenderSection("SideBar", false)
        <!-- END SIDEBAR -->
        <!-- BEGIN CONTENT -->
        @RenderBody()
        <!-- END CONTENT -->
    </div>
    <!-- END CONTAINER -->
    <!-- BEGIN FOOTER -->
    <div class="page-footer">
        <div class="page-footer-inner"> Copyright © 2015 Ideavate. All Right Reserved </div>
        <div class="scroll-to-top"> <i class="icon-arrow-up"></i> </div>
    </div>
    <!-- END FOOTER -->
    <!-- BEGIN JAVASCRIPTS -->
    <!-- BEGIN CORE PLUGINS -->
    @*<script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery.min.js")"></script>*@
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery-migrate.min.js")"></script>
    <!-- IMPORTANT! Load jquery-ui.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery-ui/jquery-ui.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap/js/bootstrap.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery.blockui.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery.cokie.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/uniform/jquery.uniform.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-toastr/toastr.min.js")"></script>

    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")"></script>
    <!-- END CORE PLUGINS -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery-tags-input/jquery.tagsinput.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-maxlength/bootstrap-maxlength.min.js")"></script>

    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery-inputmask/jquery.inputmask.bundle.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-select/bootstrap-select.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/select2/select2.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/jquery-multi-select/js/jquery.multi-select.js")"></script>

    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/pages/scripts/table-advanced.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/pages/scripts/components-dropdowns.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/pages/scripts/components-form-tools.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/pages/scripts/components-pickers.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/pages/scripts/my-slider.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/skart-open-modal/skart-open-modal.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/skart-open-modal/skart-open-alert-modal.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/skart-ajax/skart-ajax.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/skart-bind-dropdown/skart-bind-dropdown.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-ladda-ui/spin.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/plugins/bootstrap-ladda-ui/ladda.min.js")"></script>
    @RenderSection("scripts", false)
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/global/scripts/metronic.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/layout2/scripts/layout.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/layout2/scripts/demo.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/pages/scripts/ui-toastr.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Content/Template/assets/admin/pages/scripts/custom.js")"></script>
    <script src="@Url.Content("~/Content/Template/assets/admin/pages/scripts/components-jqueryui-sliders.js")"></script>
    <!-- END PAGE LEVEL SCRIPTS -->
    @{
    //string userId = "0";
    //if (ViewBag.SessionObject != null)
    //{
    //    if (ViewBag.SessionObject.UserId != null)
    //    {
    //        userId = ViewBag.SessionObject.UserId.ToString();
    //    }
    //}
    //long employeeId = 0;
    //string taskRefType = TaskRefTypeEnum.Employee.ToString();
    //string activityRefType = ActivityRefTypeEnum.Employee.ToString();
    //if (Session["SessionObject"] != null)
    //{
    //    employeeId = ((SalesProcess.Ui.ViewModel.Other.Common.SessionObject)Session["SessionObject"]).Employee.EmployeeId;
    //}
    }

    <script>

        //applyError($("#applyError"), true, "Error Message")
        function applyError(controlObj, isError, errorMsg) {
            var formGrpDiv = controlObj.closest(".form-group");
            var fieldValidationSpan = formGrpDiv.find("span[class^='field-validation-']").first();

            if (isError) {
                formGrpDiv.addClass("has-error");
                var valMsgForAttr = fieldValidationSpan.data("valmsg-for");
                fieldValidationSpan.removeClass("field-validation-valid").addClass("field-validation-error").html("<span for='" + valMsgForAttr + "' class='has-error'>" + errorMsg + "</span>");
            }
            else {
                formGrpDiv.removeClass("has-error");
                var valMsgForAttr = fieldValidationSpan.data("valmsg-for");
                fieldValidationSpan.removeClass("field-validation-error").addClass("field-validation-valid").html("");
            }
        }

        jQuery(document).ready(function () {
            // initiate layout and plugins
            Metronic.init(); // init metronic core components
            Layout.init(); // init current layout
            Demo.init(); // init demo features
            UIToastr.init();
            //TableAdvanced.init();
            ComponentsDropdowns.init();
            ComponentsFormTools.init();
            ComponentsPickers.init();
            slideToggle.init();
            Custom.init();

            /*--Bootsrat Error Class on Validation - Begin--*/
            (function ($) {
                var defaultOptions = {
                    validClass: 'has-success',
                    errorClass: 'has-error',
                    highlight: function (element, errorClass, validClass) {
                        $(element).closest(".form-group")
                            .removeClass(validClass)
                            .addClass('has-error');
                    },
                    unhighlight: function (element, errorClass, validClass) {
                        $(element).closest(".form-group")
                        .removeClass('has-error')
                        .addClass(validClass);
                    }
                };

                $.validator.setDefaults(defaultOptions);

                $.validator.unobtrusive.options = {
                    errorClass: defaultOptions.errorClass,
                    validClass: defaultOptions.validClass,
                };
            })(jQuery);
            /*--Bootsrat Error Class on Validation - End--*/
        });

        function CheckAuth(data) {
            if (data != undefined && data != null) {
                if (data.toString().indexOf("loginpageText") != -1) {
                    window.location = "/Account/Login";
                }
                else if (data.toString() == "") {
                    window.location = "/Account/Login";
                }
            }
        }

        /*--Ladda Loader Button - Begin--*/
        function StartButtonLoading(buttonSelector) {
            if (buttonSelector != undefined && buttonSelector != null && buttonSelector != "") {
                var btn = Ladda.create(document.querySelector(buttonSelector));
                btn.start();
            }
        }
        function StopButtonLoading(buttonSelector) {
            if (buttonSelector != undefined && buttonSelector != null && buttonSelector != "") {
                var btn = Ladda.create(document.querySelector(buttonSelector));
                btn.stop();
            }
        }
        /*--Ajax.BeginForm Global OnBegin & OnComplete Function - Begin--*/
        function GlobalOnBeginFunction(buttonSelector) {
            StartButtonLoading(buttonSelector);
        }
        function GlobalOnCompleteFunction(buttonSelector) {
            StopButtonLoading(buttonSelector);
        }
        /*--Ajax.BeginForm Global OnBegin & OnComplete Function - End--*/
        /*--Ladda Loader Button - End--*/

        /*--IsEditMode Check - Begin--*/
        function IsEditMode(id) {
            if (id != undefined) {
                return id != "" && id != null && id > 0;
            } else {
                return false;
            }
        }
        /*--IsEditMode Check - End--*/
    </script>
    @RenderSection("JsCallingInitFunc", false)
    <!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>
